﻿namespace ExamV5.RubricInfo
{
    using ExamV5;
    using System;
    using System.Configuration;
    using System.Data;
    using System.Data.SqlClient;
    using System.IO;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;

    public class FrmEditRubricInfo : Page
    {
        protected Button butClose;
        protected Button butDefault;
        protected CheckBoxList CBLFlag;
        protected CheckBoxList CBLOKAnswerB;
        protected DropDownList DDLDiff;
        protected DropDownList DDLRubricType;
        protected DropDownList DDLSubject;
        protected HtmlForm form1;
        protected HtmlHead Head1;
        private HttpCookie httpCookie_0 = null;
        private HttpCookie httpCookie_1 = null;
        private HttpCookie httpCookie_2 = null;
        private HttpCookie httpCookie_3 = null;
        private int int_0 = 0;
        protected Label labLookOKAnswerFileH;
        protected Label labLookOptionAnswerFileH;
        protected Label labOKAnswerFileH;
        protected Label labOptionAnswerFileH;
        protected LinkButton LBDelOKAnswerFileH;
        protected LinkButton LBDelOptionAnswerFileH;
        protected Panel PanalA;
        protected Panel PanalB;
        protected Panel PanalC;
        protected Panel PanelD;
        protected Panel PanelE;
        protected Panel PanelH;
        protected Panel PanelJ;
        private PublicFun publicFun_0 = new PublicFun();
        protected RadioButtonList RBLIsCheck;
        protected RadioButtonList RBLIsShare;
        protected RadioButtonList RBLOKAnswerA;
        protected RadioButtonList RBLOKAnswerC;

        //protected HtmlInputHidden txtOKAnswerE;
        protected string editorAnswerE;

        protected TextBox txtOKAnswerJ;
        protected TextBox txtOKMemo;
        protected TextBox txtRubricAA;
        protected TextBox txtRubricAB;
        protected TextBox txtRubricAC;
        protected TextBox txtRubricAD;
        protected TextBox txtRubricAE;
        protected TextBox txtRubricAF;
        protected TextBox txtRubricBA;
        protected TextBox txtRubricBB;
        protected TextBox txtRubricBC;
        protected TextBox txtRubricBD;
        protected TextBox txtRubricBE;
        protected TextBox txtRubricBF;
        protected TextBox txtRubricDA;
        protected TextBox txtRubricDB;
        protected TextBox txtRubricDC;
        protected TextBox txtRubricDD;
        protected TextBox txtRubricDE;
        protected TextBox txtRubricDF;
        //protected HtmlInputHidden txtRubricDocA;
        protected string editorContentA;
        //protected HtmlInputHidden txtRubricDocB;
        protected string editorContentB;
        //protected HtmlInputHidden txtRubricDocC;
        protected string editorContentC;
        //protected HtmlInputHidden txtRubricDocD;
        protected string editorContentD;
        //protected HtmlInputHidden txtRubricDocE;
        protected string editorContentE;
        //protected HtmlInputHidden txtRubricDocH;
        protected string editorContentH;
        //protected HtmlInputHidden txtRubricDocJ;
        protected string editorContentJ;
        protected HtmlInputFile UPFileOKAnswer;
        protected HtmlInputFile UPFileRubric;

        protected void butDefault_Click(object sender, EventArgs e)
        {
            string cmdText = "";
            string str2 = "";
            string str3 = "";
            string str4 = "";
            string str5 = "";
            string str6 = "";
            string str7 = "";
            string str8 = "";
            string str9 = "";
            string text = "";
            string str11 = "";
            string str12 = "N";
            string str13 = "";
            DateTime.Now.ToString();
            string text1 = this.httpCookie_0.Value;
            string str14 = "";
            string str15 = "";
            string str16 = "";
            string str17 = "";
            string str18 = "";
            string str19 = "";
            string str20 = "";
            string str21 = "";
            string str22 = "";
            string str23 = "";
            string str24 = "";
            string str25 = "";
            if (this.PanalA.Visible)
            {
                str14 = this.txtRubricAA.Text.Replace("'", "＇").Replace("#", "＃");
                str15 = this.txtRubricAB.Text.Replace("'", "＇").Replace("#", "＃");
                str16 = this.txtRubricAC.Text.Replace("'", "＇").Replace("#", "＃");
                str17 = this.txtRubricAD.Text.Replace("'", "＇").Replace("#", "＃");
                str18 = this.txtRubricAE.Text.Replace("'", "＇").Replace("#", "＃");
                str19 = this.txtRubricAF.Text.Replace("'", "＇").Replace("#", "＃");
            }
            if (this.PanalB.Visible)
            {
                str20 = this.txtRubricBA.Text.Replace("'", "＇").Replace("#", "＃");
                str21 = this.txtRubricBB.Text.Replace("'", "＇").Replace("#", "＃");
                str22 = this.txtRubricBC.Text.Replace("'", "＇").Replace("#", "＃");
                str23 = this.txtRubricBD.Text.Replace("'", "＇").Replace("#", "＃");
                str24 = this.txtRubricBE.Text.Replace("'", "＇").Replace("#", "＃");
                str25 = this.txtRubricBF.Text.Replace("'", "＇").Replace("#", "＃");
            }
            if (this.CBLFlag.SelectedIndex < 0)
            {
                base.Response.Write("<script>alert('请选择所属题库！')</script>");
            }
            else if ((this.DDLSubject.SelectedItem.Value == "0") || (this.DDLSubject.SelectedIndex == -1))
            {
                base.Response.Write("<script>alert('请选择所属科目！')</script>");
            }
            else
            {
                str2 = this.DDLSubject.SelectedItem.Value;
                if (!(!(this.DDLRubricType.SelectedItem.Value == "0") ? (this.DDLRubricType.SelectedIndex != -1) : false))
                {
                    base.Response.Write("<script>alert('请选择题目类型信息！')</script>");
                }
                else
                {
                    str3 = this.DDLRubricType.SelectedItem.Value;
                    if ((this.DDLDiff.SelectedItem.Value == "0") || (this.DDLDiff.SelectedIndex == -1))
                    {
                        base.Response.Write("<script>alert('请选择题目难易程度！')</script>");
                    }
                    else
                    {
                        str5 = this.DDLDiff.SelectedItem.Value;
                        if ((this.RBLIsCheck.SelectedItem.Value == "0") || (this.RBLIsCheck.SelectedIndex == -1))
                        {
                            base.Response.Write("<script>alert('请选择题目是否审核！')</script>");
                        }
                        else
                        {
                            str9 = this.RBLIsCheck.SelectedItem.Value;
                            if (!(!(this.RBLIsShare.SelectedItem.Value == "0") ? (this.RBLIsShare.SelectedIndex != -1) : false))
                            {
                                base.Response.Write("<script>alert('请选择题目是否共享！')</script>");
                            }
                            else
                            {
                                SqlConnection connection;
                                SqlCommand command;
                                int num;
                                str8 = this.RBLIsShare.SelectedItem.Value;
                                if (this.PanalA.Visible)
                                {

                                    //if (this.txtRubricDocA.Value.Trim() == "")
                                    //{
                                    //    base.Response.Write("<script>alert('请输入题目内容！')</script>");
                                    //    return;
                                    //}
                                    //str4 = this.txtRubricDocA.Value.Trim();
                                    str4 = this.Request.Form["editorContentA"].ToString().Trim();
                                    if (str4 == "")
                                    {
                                        base.Response.Write("<script>alert('请输入题目内容！')</script>");
                                        return;
                                    }

                                    if (this.RBLOKAnswerA.SelectedIndex == -1)
                                    {
                                        base.Response.Write("<script>alert('请输入正确答案！')</script>");
                                        return;
                                    }
                                    str7 = this.RBLOKAnswerA.SelectedItem.Value;
                                    if (!(!(str14.Trim() == "") ? !(str15.Trim() == "") : false))
                                    {
                                        base.Response.Write("<script>alert('请选择输入可选答案！')</script>");
                                        return;
                                    }
                                    str6 = str14 + "#" + str15 + "#" + str16 + "#" + str17 + "#" + str18 + "#" + str19;
                                }
                                if (this.PanalB.Visible)
                                {
                                    //if (this.txtRubricDocB.Value.Trim() == "")
                                    //{
                                    //    base.Response.Write("<script>alert('请输入题目内容！')</script>");
                                    //    return;
                                    //}
                                    //str4 = this.txtRubricDocB.Value.Trim();
                                    str4 = this.Request.Form["editorContentB"].ToString().Trim();
                                    if (str4 == "")
                                    {
                                        base.Response.Write("<script>alert('请输入题目内容！')</script>");
                                        return;
                                    }
                                    if (this.CBLOKAnswerB.SelectedIndex == -1)
                                    {
                                        base.Response.Write("<script>alert('请输入正确答案！')</script>");
                                        return;
                                    }
                                    for (int i = 0; i < this.CBLOKAnswerB.Items.Count; i++)
                                    {
                                        if (this.CBLOKAnswerB.Items[i].Selected)
                                        {
                                            if (str7 == "")
                                            {
                                                str7 = this.CBLOKAnswerB.Items[i].Text.Trim();
                                            }
                                            else
                                            {
                                                str7 = str7 + "#" + this.CBLOKAnswerB.Items[i].Text.Trim();
                                            }
                                        }
                                    }
                                    string str44 = this.publicFun_0.GetValues("select ParmValue from SysParmInfo where ParmMemo='BRubricType'", "ParmValue").Trim();
                                    if (!(!(str44.Trim() == "") ? !(str44.Trim() == "Y") : false) && (str7.IndexOf("#") < 0))
                                    {
                                        base.Response.Write("<script>alert('多选题未设置不定项选择，所以正确答案必须为两个以上！')</script>");
                                        return;
                                    }
                                    if (!(!(str20.Trim() == "") ? !(str21.Trim() == "") : false))
                                    {
                                        base.Response.Write("<script>alert('请选择输入可选答案！')</script>");
                                        return;
                                    }
                                    str6 = str20 + "#" + str21 + "#" + str22 + "#" + str23 + "#" + str24 + "#" + str25;
                                }
                                if (this.PanalC.Visible)
                                {
                                    //if (this.txtRubricDocC.Value.Trim() == "")
                                    //{
                                    //    base.Response.Write("<script>alert('请输入题目内容！')</script>");
                                    //    return;
                                    //}
                                    //str4 = this.txtRubricDocC.Value.Trim();
                                    str4 = this.Request.Form["editorContentC"].ToString().Trim();
                                    if (str4 == "")
                                    {
                                        base.Response.Write("<script>alert('请输入题目内容！')</script>");
                                        return;
                                    }
                                    if (this.RBLOKAnswerC.SelectedIndex == -1)
                                    {
                                        base.Response.Write("<script>alert('请输入正确答案！')</script>");
                                        return;
                                    }
                                    str7 = this.RBLOKAnswerC.SelectedItem.Value;
                                }
                                if (this.PanelD.Visible)
                                {
                                    //if (this.txtRubricDocD.Value.Trim() == "")
                                    //{
                                    //    base.Response.Write("<script>alert('请输入题目内容！')</script>");
                                    //    return;
                                    //}
                                    //str4 = this.txtRubricDocD.Value.Trim();
                                    str4 = this.Request.Form["editorContentD"].ToString().Trim();
                                    if (str4 == "")
                                    {
                                        base.Response.Write("<script>alert('请输入题目内容！')</script>");
                                        return;
                                    }
                                    string str42 = this.txtRubricDA.Text.ToString().Replace("'", "＇");
                                    string str40 = this.txtRubricDB.Text.ToString().Replace("'", "＇");
                                    string str41 = this.txtRubricDC.Text.ToString().Replace("'", "＇");
                                    string str37 = this.txtRubricDD.Text.ToString().Replace("'", "＇");
                                    string str38 = this.txtRubricDE.Text.ToString().Replace("'", "＇");
                                    string str39 = this.txtRubricDF.Text.ToString().Replace("'", "＇");
                                    str7 = str42 + "#" + str40 + "#" + str41 + "#" + str37 + "#" + str38 + "#" + str39;
                                    string[] strArray4 = str4.Replace("___", "〓").Split(new char[] { '〓' });
                                    string str36 = "";
                                    switch (strArray4.Length)
                                    {
                                        case 0:
                                            str36 = "请按填空题规范出题";
                                            break;

                                        case 1:
                                            str36 = "请按填空题规范出题";
                                            break;

                                        case 2:
                                            if (str42.Trim() == "")
                                            {
                                                str36 = "正确答案1不可以为空";
                                            }
                                            break;

                                        case 3:
                                            if (!(!(str42.Trim() == "") ? !(str40.Trim() == "") : false))
                                            {
                                                str36 = "正确答案1、2不可以为空";
                                            }
                                            break;

                                        case 4:
                                            if (!((!(str42.Trim() == "") && !(str40.Trim() == "")) ? !(str41.Trim() == "") : false))
                                            {
                                                str36 = "正确答案1、2、3不可以为空";
                                            }
                                            break;

                                        case 5:
                                            if ((((str42.Trim() == "") || (str40.Trim() == "")) || (str41.Trim() == "")) || (str37.Trim() == ""))
                                            {
                                                str36 = "正确答案1、2、3、4不可以为空";
                                            }
                                            break;

                                        case 6:
                                            if ((((str42.Trim() == "") || (str40.Trim() == "")) || ((str41.Trim() == "") || (str37.Trim() == ""))) || (str38.Trim() == ""))
                                            {
                                                str36 = "正确答案1、2、3、4、5不可以为空";
                                            }
                                            break;

                                        default:
                                            if (((((str42.Trim() == "") || (str40.Trim() == "")) || ((str41.Trim() == "") || (str37.Trim() == ""))) || (str38.Trim() == "")) || (str39.Trim() == ""))
                                            {
                                                str36 = "正确答案1、2、3、4、5、6不可以为空";
                                            }
                                            break;
                                    }
                                    if (str36.Trim() != "")
                                    {
                                        base.Response.Write("<script>alert('" + str36 + "！')</script>");
                                        return;
                                    }
                                }
                                if (this.PanelE.Visible)
                                {
                                    //if (this.txtRubricDocE.Value.Trim() == "")
                                    //{
                                    //    base.Response.Write("<script>alert('请输入题目内容！')</script>");
                                    //    return;
                                    //}
                                    //str4 = this.txtRubricDocE.Value.Trim();
                                    str4 = this.Request.Form["editorContentE"].ToString().Trim();
                                    if (str4 == "")
                                    {
                                        base.Response.Write("<script>alert('请输入题目内容！')</script>");
                                        return;
                                    }
                                    //if (this.txtOKAnswerE.Value.Trim() == "")
                                    //{
                                    //    base.Response.Write("<script>alert('请输入正确答案！')</script>");
                                    //    return;
                                    //}
                                    //str7 = this.txtOKAnswerE.Value.Trim();
                                    str7 = this.Request.Form["editorAnswerE"].ToString().Trim();
                                    if (str7 == "")
                                    {
                                        base.Response.Write("<script>alert('请输入正确答案！')</script>");
                                        return;
                                    }
                                }
                                if (this.PanelH.Visible)
                                {
                                    //if (this.txtRubricDocH.Value.Trim() == "")
                                    //{
                                    //    base.Response.Write("<script>alert('请输入题目内容！')</script>");
                                    //    return;
                                    //}
                                    //str4 = this.txtRubricDocH.Value.Trim();
                                    str4 = this.Request.Form["editorContentH"].ToString().Trim();
                                    if (str4 == "")
                                    {
                                        base.Response.Write("<script>alert('请输入题目内容！')</script>");
                                        return;
                                    }
                                    string fileName = this.UPFileRubric.PostedFile.FileName;
                                    string extension = "";
                                    string path = this.UPFileOKAnswer.PostedFile.FileName;
                                    string str31 = "";
                                    if (fileName != "")
                                    {
                                        extension = Path.GetExtension(fileName);
                                        string str35 = ".asp.exe.dll.bat.aspx.asa.asax.ascx.ashx.asmx.axd.cdx.cer.config.cs.csproj.idc.java.jsl.licx.rem.resources.resx.shtm.shtml.soap.stm.vb.vbproj.vjsproj.vsdisco.webinfo";
                                        if (str35.IndexOf(extension.ToLower()) > -1)
                                        {
                                            base.Response.Write("<script>alert('附件文件非法,无法上传！')</script>");
                                            return;
                                        }
                                        fileName = string.Concat(new object[] { this.httpCookie_0.Value, DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, DateTime.Now.Month, DateTime.Now.Hour, DateTime.Now.Minute, DateTime.Now.Millisecond, "0", extension });
                                        this.UPFileRubric.PostedFile.SaveAs(base.Server.MapPath("../") + @"\PublicFile\" + fileName);
                                    }
                                    str6 = fileName;
                                    path = Path.GetFileName(path);
                                    if (path != "")
                                    {
                                        str31 = Path.GetExtension(path);
                                        string str32 = ".asp.exe.dll.bat.aspx.asa.asax.ascx.ashx.asmx.axd.cdx.cer.config.cs.csproj.idc.java.jsl.licx.rem.resources.resx.shtm.shtml.soap.stm.vb.vbproj.vjsproj.vsdisco.webinfo";
                                        if (str32.IndexOf(str31.ToLower()) > -1)
                                        {
                                            base.Response.Write("<script>alert('附件文件非法,无法上传！')</script>");
                                            return;
                                        }
                                        path = string.Concat(new object[] { this.httpCookie_0.Value, DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, DateTime.Now.Month, DateTime.Now.Hour, DateTime.Now.Minute, DateTime.Now.Millisecond, "1", str31 });
                                        this.UPFileOKAnswer.PostedFile.SaveAs(base.Server.MapPath("../") + @"\PublicFile\" + path);
                                    }
                                    str7 = path;
                                }
                                if (this.PanelJ.Visible)
                                {
                                    //if (this.txtRubricDocJ.Value.Trim() == "")
                                    //{
                                    //    base.Response.Write("<script>alert('请输入综合题题目内容！')</script>");
                                    //    return;
                                    //}
                                    //str4 = this.txtRubricDocJ.Value.Trim();
                                    str4 = this.Request.Form["editorContentJ"].ToString().Trim();
                                    if (str4 == "")
                                    {
                                        base.Response.Write("<script>alert('请输入综合题题目内容！')</script>");
                                        return;
                                    }
                                    if (this.txtOKAnswerJ.Text.Trim() == "")
                                    {
                                        base.Response.Write("<script>alert('请输入综合题正确答案！')</script>");
                                        return;
                                    }
                                    str7 = this.txtOKAnswerJ.Text.Trim();
                                    string[] strArray2 = str4.Replace("___", "〓").Split(new char[] { '〓' });
                                    string[] strArray3 = str7.Split(new char[] { '#' });
                                    if (!(((strArray2.Length - 1) == strArray3.Length) ? (strArray2.Length != 1) : false))
                                    {
                                        base.Response.Write("<script>alert('综合题输入非法,答案与试题的选项不对应！')</script>");
                                        return;
                                    }
                                }
                                text = this.txtOKMemo.Text;
                                str6 = str6.Replace("<P>", "").Replace("<P align=right>", "").Replace("<P align=center>", "").Replace("<P align=left>", "").Replace("</P>", "");
                                str4 = str4.Replace("<P>", "").Replace("<P align=right>", "").Replace("<P align=center>", "").Replace("<P align=left>", "").Replace("</P>", "");
                                str7 = str7.Replace("<P>", "").Replace("<P align=right>", "").Replace("<P align=center>", "").Replace("<P align=left>", "").Replace("</P>", "");
                                if (this.int_0 != 0)
                                {
                                    int num2 = 0;
                                    for (num = 0; num < this.CBLFlag.Items.Count; num++)
                                    {
                                        if (this.CBLFlag.Items[num].Selected)
                                        {
                                            num2++;
                                        }
                                    }
                                    if (num2 > 1)
                                    {
                                        base.Response.Write("<script>alert('修改试题只能选择一项所属题库信息！')</script>");
                                    }
                                    else
                                    {
                                        str11 = this.CBLFlag.SelectedItem.Value;
                                        if (this.PanelH.Visible)
                                        {
                                            if (str6.Trim() == "")
                                            {
                                                str6 = this.labOptionAnswerFileH.Text.Trim();
                                            }
                                            if (str7.Trim() == "")
                                            {
                                                str7 = this.labOKAnswerFileH.Text.Trim();
                                            }
                                        }
                                        cmdText = "update RubricInfo set RubricType=@RubricType,SubjectID=@SubjectID,RubricTitle=@RubricTitle,Difficulty=@Difficulty,OptionAnswer=@OptionAnswer,OKAnswer=@OKAnswer,IsShare=@IsShare,ISCheck=@ISCheck,";
                                        cmdText = cmdText + "Flag=@Flag,CreatTime=@CreatTime,CreatNumberNO=@CreatNumberNO,OKMemo=@OKMemo where ID=" + this.int_0;
                                        connection = new SqlConnection(ConfigurationManager.ConnectionStrings["Conn"].ConnectionString);
                                        connection.Open();
                                        command = new SqlCommand(cmdText, connection);
                                        command.Parameters.Add("@RubricType", SqlDbType.Char, 1).Value = str3;
                                        command.Parameters.Add("@SubjectID", SqlDbType.Int).Value = str2;
                                        command.Parameters.Add("@RubricTitle", SqlDbType.Text).Value = str4;
                                        command.Parameters.Add("@Difficulty", SqlDbType.Char, 1).Value = str5;
                                        command.Parameters.Add("@OptionAnswer", SqlDbType.Text).Value = str6;
                                        command.Parameters.Add("@OKAnswer", SqlDbType.Text).Value = str7;
                                        command.Parameters.Add("@IsShare", SqlDbType.Char, 1).Value = str8;
                                        command.Parameters.Add("@ISCheck", SqlDbType.VarChar, 3).Value = str9;
                                        command.Parameters.Add("@CreatTime", SqlDbType.VarChar, 20).Value = DateTime.Now.ToString();
                                        command.Parameters.Add("@CreatNumberNO", SqlDbType.VarChar, 20).Value = this.httpCookie_0.Value;
                                        command.Parameters.Add("@OKMemo", SqlDbType.Text).Value = text;
                                        command.Parameters.Add("@Flag", SqlDbType.Char, 1).Value = str11;
                                        command.ExecuteNonQuery();
                                        command.Dispose();
                                        connection.Close();
                                        connection.Dispose();
                                        this.publicFun_0.ExecuteSql("insert into SysLogInfo(LogDisp,EditUser,EditUserCode) values('修改题目信息！','" + this.httpCookie_1.Value + "','" + this.httpCookie_0.Value + "')");
                                        base.Response.Write("<script>alert('修改试题操作成功！');var index = parent.layer.getFrameIndex(window.name);parent.layer.close(index);parent.location.reload();</script>");
                                    }
                                }
                                else if ((this.publicFun_0.GetValues("select ParmValue from SysParmInfo where ParmMemo='RubricLoop'", "ParmValue").Trim().Trim() == "Y") && (this.publicFun_0.GetValues("select ID from RubricInfo where RubricTitle like '%" + str4 + "%'", "ID") != ""))
                                {
                                    base.Response.Write("<script>alert('此道试题在题库中已经存在，请仔细核实！')</script>");
                                }
                                else
                                {
                                    Random random = new Random();
                                    str13 = random.Next(0x2710).ToString();
                                    str12 = "N";
                                    for (num = 0; num < this.CBLFlag.Items.Count; num++)
                                    {
                                        if (this.CBLFlag.Items[num].Selected)
                                        {
                                            str11 = this.CBLFlag.Items[num].Value;
                                            cmdText = "Insert into RubricInfo(RubricType,SubjectID,RubricTitle,Difficulty,OptionAnswer,OKAnswer,OKMemo,IsShare,IsCheck,Flag,IsUse,IsDel,RndNumber,CreatNumberNO) Values(";
                                            cmdText = cmdText + "@RubricType,@SubjectID,@RubricTitle,@Difficulty,@OptionAnswer,@OKAnswer,@OKMemo,@IsShare,@IsCheck,@Flag,@IsUse,@IsDel,@RndNumber,@CreatNumberNO)";
                                            connection = new SqlConnection(ConfigurationManager.ConnectionStrings["Conn"].ConnectionString);
                                            connection.Open();
                                            command = new SqlCommand(cmdText, connection);
                                            command.Parameters.Add("@RubricType", SqlDbType.Char, 1).Value = str3;
                                            command.Parameters.Add("@SubjectID", SqlDbType.Int).Value = str2;
                                            command.Parameters.Add("@RubricTitle", SqlDbType.Text).Value = str4;
                                            command.Parameters.Add("@Difficulty", SqlDbType.Char, 1).Value = str5;
                                            command.Parameters.Add("@OptionAnswer", SqlDbType.Text).Value = str6;
                                            command.Parameters.Add("@OKAnswer", SqlDbType.Text).Value = str7;
                                            command.Parameters.Add("@OKMemo", SqlDbType.Text).Value = text;
                                            command.Parameters.Add("@IsShare", SqlDbType.Char, 1).Value = str8;
                                            command.Parameters.Add("@ISCheck", SqlDbType.Char, 1).Value = str9;
                                            command.Parameters.Add("@Flag", SqlDbType.Char, 1).Value = str11;
                                            command.Parameters.Add("@IsUse", SqlDbType.Char, 1).Value = str12;
                                            command.Parameters.Add("@IsDel", SqlDbType.Char, 1).Value = "N";
                                            command.Parameters.Add("@RndNumber", SqlDbType.Int).Value = str13;
                                            command.Parameters.Add("@CreatNumberNO", SqlDbType.VarChar, 20).Value = this.httpCookie_0.Value;
                                            command.ExecuteNonQuery();
                                            command.Dispose();
                                            connection.Close();
                                            connection.Dispose();
                                        }
                                    }
                                    //this.txtRubricDocA.Value = "";
                                    //this.txtRubricDocB.Value = "";
                                    //this.txtRubricDocC.Value = "";
                                    //this.txtRubricDocD.Value = "";
                                    //this.txtRubricDocE.Value = "";
                                    //this.txtRubricDocH.Value = "";
                                    //this.txtRubricDocJ.Value = "";
                                    this.editorContentA = "";
                                    this.editorContentB = "";
                                    this.editorContentC = "";
                                    this.editorContentD = "";
                                    this.editorContentE = "";
                                    this.editorContentH = "";
                                    this.editorContentJ = "";
                                    this.txtOKMemo.Text = "";
                                    this.txtRubricAA.Text = "";
                                    this.txtRubricAB.Text = "";
                                    this.txtRubricAC.Text = "";
                                    this.txtRubricAD.Text = "";
                                    this.txtRubricAE.Text = "";
                                    this.txtRubricAF.Text = "";
                                    this.txtRubricBA.Text = "";
                                    this.txtRubricBB.Text = "";
                                    this.txtRubricBC.Text = "";
                                    this.txtRubricBD.Text = "";
                                    this.txtRubricBE.Text = "";
                                    this.txtRubricBF.Text = "";
                                    this.txtRubricDA.Text = "";
                                    this.txtRubricDB.Text = "";
                                    this.txtRubricDC.Text = "";
                                    this.txtRubricDD.Text = "";
                                    this.txtRubricDE.Text = "";
                                    this.txtRubricDF.Text = "";
                                    //this.txtOKAnswerE.Value = "";
                                    this.editorAnswerE = "";
                                    this.txtOKAnswerJ.Text = "";
                                    this.RBLOKAnswerA.SelectedIndex = -1;
                                    this.CBLOKAnswerB.SelectedIndex = -1;
                                    this.RBLOKAnswerC.SelectedIndex = -1;
                                    this.RBLIsShare.SelectedIndex = -1;
                                    this.RBLIsCheck.SelectedIndex = -1;
                                    this.RBLIsShare.SelectedIndex = 0;
                                    this.RBLIsCheck.SelectedIndex = 0;
                                    this.publicFun_0.ExecuteSql("insert into SysLogInfo(LogDisp,EditUser,EditUserCode) values('添加题目信息！','" + this.httpCookie_1.Value + "','" + this.httpCookie_0.Value + "')");
                                    base.Response.Write("<script>alert('添加试题操作成功！');setTimeout(function(){window.opener.document.URL='FrmManagRubricInfo.aspx?SubjectID=" + str2 + "&TypeID=0'},500);</script>");
                                }
                            }
                        }
                    }
                }
            }
        }

        protected void DDLRubricType_SelectedIndexChanged(object sender, EventArgs e)
        {
            switch (this.DDLRubricType.SelectedItem.Value)
            {
                case "0":
                    this.PanalA.Visible = true;
                    this.PanalB.Visible = false;
                    this.PanalC.Visible = false;
                    this.PanelD.Visible = false;
                    this.PanelE.Visible = false;
                    this.PanelH.Visible = false;
                    this.PanelJ.Visible = false;
                    break;

                case "A":
                    this.PanalA.Visible = true;
                    this.PanalB.Visible = false;
                    this.PanalC.Visible = false;
                    this.PanelD.Visible = false;
                    this.PanelE.Visible = false;
                    this.PanelH.Visible = false;
                    this.PanelJ.Visible = false;
                    break;

                case "B":
                    this.PanalA.Visible = false;
                    this.PanalB.Visible = true;
                    this.PanalC.Visible = false;
                    this.PanelD.Visible = false;
                    this.PanelE.Visible = false;
                    this.PanelH.Visible = false;
                    this.PanelJ.Visible = false;
                    break;

                case "C":
                    this.PanalA.Visible = false;
                    this.PanalB.Visible = false;
                    this.PanalC.Visible = true;
                    this.PanelD.Visible = false;
                    this.PanelE.Visible = false;
                    this.PanelH.Visible = false;
                    this.PanelJ.Visible = false;
                    break;

                case "D":
                    this.PanalA.Visible = false;
                    this.PanalB.Visible = false;
                    this.PanalC.Visible = false;
                    this.PanelD.Visible = true;
                    this.PanelE.Visible = false;
                    this.PanelH.Visible = false;
                    this.PanelJ.Visible = false;
                    break;

                case "E":
                    this.PanalA.Visible = false;
                    this.PanalB.Visible = false;
                    this.PanalC.Visible = false;
                    this.PanelD.Visible = false;
                    this.PanelE.Visible = true;
                    this.PanelH.Visible = false;
                    this.PanelJ.Visible = false;
                    break;

                case "F":
                    this.PanalA.Visible = false;
                    this.PanalB.Visible = false;
                    this.PanalC.Visible = false;
                    this.PanelD.Visible = false;
                    this.PanelE.Visible = true;
                    this.PanelH.Visible = false;
                    this.PanelJ.Visible = false;
                    break;

                case "G":
                    this.PanalA.Visible = false;
                    this.PanalB.Visible = false;
                    this.PanalC.Visible = false;
                    this.PanelD.Visible = false;
                    this.PanelE.Visible = true;
                    this.PanelH.Visible = false;
                    this.PanelJ.Visible = false;
                    break;

                case "H":
                    this.PanalA.Visible = false;
                    this.PanalB.Visible = false;
                    this.PanalC.Visible = false;
                    this.PanelD.Visible = false;
                    this.PanelE.Visible = true;
                    this.PanelH.Visible = false;
                    this.PanelJ.Visible = false;
                    break;

                case "I":
                    this.PanalA.Visible = false;
                    this.PanalB.Visible = false;
                    this.PanalC.Visible = false;
                    this.PanelD.Visible = false;
                    this.PanelE.Visible = false;
                    this.PanelH.Visible = true;
                    this.PanelJ.Visible = false;
                    break;

                case "J":
                    this.PanalA.Visible = false;
                    this.PanalB.Visible = false;
                    this.PanalC.Visible = false;
                    this.PanelD.Visible = false;
                    this.PanelE.Visible = false;
                    this.PanelH.Visible = false;
                    this.PanelJ.Visible = true;
                    break;
            }
        }

        protected void LBDelOKAnswerFileH_Click(object sender, EventArgs e)
        {
            if (this.labOKAnswerFileH.Text != "")
            {
                File.Delete(base.Server.MapPath("../") + @"\PublicFile\" + this.labOKAnswerFileH.Text.Trim());
                this.labOKAnswerFileH.Visible = false;
                this.labLookOKAnswerFileH.Visible = false;
                this.LBDelOKAnswerFileH.Visible = false;
                this.publicFun_0.ExecuteSql("update RubricInfo set OKAnswer='' where ID=" + this.int_0);
            }
        }

        protected void LBDelOptionAnswerFileH_Click(object sender, EventArgs e)
        {
            if (this.labOptionAnswerFileH.Text != "")
            {
                File.Delete(base.Server.MapPath("../") + @"\PublicFile\" + this.labOptionAnswerFileH.Text.Trim());
                this.labOptionAnswerFileH.Visible = false;
                this.labLookOptionAnswerFileH.Visible = false;
                this.LBDelOptionAnswerFileH.Visible = false;
                this.publicFun_0.ExecuteSql("update RubricInfo set OptionAnswer='' where ID=" + this.int_0);
            }
        }

        private void method_0(bool bool_0)
        {
            try
            {
                int num2;
                string[] strArray;
                int num5;
                string[] strArray3;
                int num6;
                string[] strArray4;
                string cmdText = "";
                string str2 = "";
                SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["Conn"].ConnectionString);
                connection.Open();
                cmdText = "select ID,SubjectID,RubricType,RubricTitle,Difficulty,OptionAnswer,OKAnswer,IsShare,ISCheck,Flag,IsUse,OKMemo from RubricInfo where ID=" + this.int_0;
                if (this.ViewState["ManagPower"].ToString() != "Y")
                {
                    if (this.ViewState["AddPower"].ToString() != "Y")
                    {
                        cmdText = cmdText + " and CreatNumberNO=''";
                    }
                    else
                    {
                        cmdText = cmdText + " and CreatNumberNO='" + this.httpCookie_0.Value + "'";
                    }
                }
                SqlDataReader reader = new SqlCommand(cmdText, connection).ExecuteReader(CommandBehavior.CloseConnection);
                if (!reader.Read())
                {
                    goto Label_0F22;
                }
                str2 = reader["OptionAnswer"].ToString().Trim();
                this.CBLFlag.SelectedIndex = -1;
                this.DDLSubject.SelectedIndex = -1;
                this.CBLFlag.Items.FindByValue(reader["Flag"].ToString()).Selected = true;
                this.DDLRubricType.SelectedIndex = -1;
                this.DDLRubricType.Items.FindByValue(reader["RubricType"].ToString()).Selected = true;
                if (bool_0)
                {
                    this.DDLRubricType.Enabled = false;
                    this.CBLFlag.Enabled = false;
                    this.DDLSubject.Enabled = false;
                }
                else
                {
                    this.DDLRubricType.Enabled = true;
                    this.CBLFlag.Enabled = true;
                    this.DDLSubject.Enabled = true;
                }
                this.txtOKMemo.Text = reader["OKMemo"].ToString();
                switch (reader["RubricType"].ToString())
                {
                    case "A":
                        //this.txtRubricDocA.Value = reader["RubricTitle"].ToString();
                        this.editorContentA = reader["RubricTitle"].ToString();
                        this.PanalA.Visible = true;
                        this.PanalB.Visible = false;
                        this.PanalC.Visible = false;
                        this.PanelD.Visible = false;
                        this.PanelE.Visible = false;
                        this.PanelH.Visible = false;
                        this.PanelJ.Visible = false;
                        strArray4 = str2.Split(new char[] { '#' });
                        num6 = 0;
                        goto Label_0427;

                    case "B":
                        //this.txtRubricDocB.Value = reader["RubricTitle"].ToString();
                        this.editorContentB = reader["RubricTitle"].ToString();
                        this.PanalA.Visible = false;
                        this.PanalB.Visible = true;
                        this.PanalC.Visible = false;
                        this.PanelD.Visible = false;
                        this.PanelE.Visible = false;
                        this.PanelH.Visible = false;
                        this.PanelJ.Visible = false;
                        strArray3 = str2.Split(new char[] { '#' });
                        num5 = 0;
                        goto Label_05F1;

                    case "C":
                        str2 = reader["OKAnswer"].ToString().Trim();
                        //this.txtRubricDocC.Value = reader["RubricTitle"].ToString();
                        this.editorContentC = reader["RubricTitle"].ToString();
                        this.PanalA.Visible = false;
                        this.PanalB.Visible = false;
                        this.PanalC.Visible = true;
                        this.PanelD.Visible = false;
                        this.PanelE.Visible = false;
                        this.PanelH.Visible = false;
                        this.PanelJ.Visible = false;
                        this.RBLOKAnswerC.SelectedIndex = -1;
                        if (str2 == "Y")
                        {
                            goto Label_0743;
                        }
                        this.RBLOKAnswerC.Items.FindByValue("N").Selected = true;
                        goto Label_075E;

                    case "D":
                        //this.txtRubricDocD.Value = reader["RubricTitle"].ToString();
                        this.editorContentD = reader["RubricTitle"].ToString();
                        this.PanalA.Visible = false;
                        this.PanalB.Visible = false;
                        this.PanalC.Visible = false;
                        this.PanelD.Visible = true;
                        this.PanelE.Visible = false;
                        this.PanelH.Visible = false;
                        this.PanelJ.Visible = false;
                        strArray = reader["OKAnswer"].ToString().Split(new char[] { '#' });
                        num2 = 0;
                        goto Label_08F8;

                    case "E":
                        //this.txtRubricDocE.Value = reader["RubricTitle"].ToString();
                        this.editorContentE = reader["RubricTitle"].ToString();
                        this.PanalA.Visible = false;
                        this.PanalB.Visible = false;
                        this.PanalC.Visible = false;
                        this.PanelD.Visible = false;
                        this.PanelE.Visible = true;
                        this.PanelH.Visible = false;
                        this.PanelJ.Visible = false;
                        //this.txtOKAnswerE.Value = reader["OKAnswer"].ToString();
                        this.editorAnswerE = reader["OKAnswer"].ToString();
                        goto Label_0E6E;

                    case "F":
                        //this.txtRubricDocE.Value = reader["RubricTitle"].ToString();
                        this.editorContentE = reader["RubricTitle"].ToString();
                        this.PanalA.Visible = false;
                        this.PanalB.Visible = false;
                        this.PanalC.Visible = false;
                        this.PanelD.Visible = false;
                        this.PanelE.Visible = true;
                        this.PanelH.Visible = false;
                        this.PanelJ.Visible = false;
                        //this.txtOKAnswerE.Value = reader["OKAnswer"].ToString();
                        this.editorAnswerE = reader["OKAnswer"].ToString();
                        goto Label_0E6E;

                    case "G":
                        //this.txtRubricDocE.Value = reader["RubricTitle"].ToString();
                        this.editorContentE = reader["RubricTitle"].ToString();
                        this.PanalA.Visible = false;
                        this.PanalB.Visible = false;
                        this.PanalC.Visible = false;
                        this.PanelD.Visible = false;
                        this.PanelE.Visible = true;
                        this.PanelH.Visible = false;
                        this.PanelJ.Visible = false;
                        //this.txtOKAnswerE.Value = reader["OKAnswer"].ToString();
                        this.editorAnswerE = reader["OKAnswer"].ToString();
                        goto Label_0E6E;

                    case "H":
                        //this.txtRubricDocE.Value = reader["RubricTitle"].ToString();
                        this.editorContentE = reader["RubricTitle"].ToString();
                        this.PanalA.Visible = false;
                        this.PanalB.Visible = false;
                        this.PanalC.Visible = false;
                        this.PanelD.Visible = false;
                        this.PanelE.Visible = true;
                        this.PanelH.Visible = false;
                        this.PanelJ.Visible = false;
                        //this.txtOKAnswerE.Value = reader["OKAnswer"].ToString();
                        this.editorAnswerE = reader["OKAnswer"].ToString();
                        goto Label_0E6E;

                    case "I":
                        //this.txtRubricDocH.Value = reader["RubricTitle"].ToString();
                        this.editorContentH = reader["RubricTitle"].ToString();
                        this.PanalA.Visible = false;
                        this.PanalB.Visible = false;
                        this.PanalC.Visible = false;
                        this.PanelD.Visible = false;
                        this.PanelE.Visible = false;
                        this.PanelH.Visible = true;
                        this.PanelJ.Visible = false;
                        if (str2 != "")
                        {
                            goto Label_0C9F;
                        }
                        this.labOptionAnswerFileH.Visible = false;
                        this.labOptionAnswerFileH.Text = "";
                        this.labLookOptionAnswerFileH.Visible = false;
                        this.LBDelOptionAnswerFileH.Visible = false;
                        goto Label_0CEA;

                    case "J":
                        //this.txtRubricDocJ.Value = reader["RubricTitle"].ToString();
                        this.editorContentJ = reader["RubricTitle"].ToString();
                        this.PanalA.Visible = false;
                        this.PanalB.Visible = false;
                        this.PanalC.Visible = false;
                        this.PanelD.Visible = false;
                        this.PanelE.Visible = false;
                        this.PanelH.Visible = false;
                        this.PanelJ.Visible = true;
                        this.txtOKAnswerJ.Text = reader["OKAnswer"].ToString();
                        if (bool_0)
                        {
                            goto Label_0E62;
                        }
                        this.txtOKAnswerJ.Enabled = true;
                        goto Label_0E6E;

                    default:
                        goto Label_0E6E;
                }
                Label_0355:
                if (strArray4[num6].ToString() != "")
                {
                    switch (num6)
                    {
                        case 0:
                            this.txtRubricAA.Text = strArray4[num6].ToString();
                            break;

                        case 1:
                            this.txtRubricAB.Text = strArray4[num6].ToString();
                            break;

                        case 2:
                            this.txtRubricAC.Text = strArray4[num6].ToString();
                            break;

                        case 3:
                            this.txtRubricAD.Text = strArray4[num6].ToString();
                            break;

                        case 4:
                            this.txtRubricAE.Text = strArray4[num6].ToString();
                            break;

                        case 5:
                            this.txtRubricAF.Text = strArray4[num6].ToString();
                            break;
                    }
                }
                num6++;
                Label_0427:
                if (num6 < strArray4.Length)
                {
                    goto Label_0355;
                }
                this.RBLOKAnswerA.SelectedIndex = -1;
                this.RBLOKAnswerA.Items.FindByText(reader["OKAnswer"].ToString()).Selected = true;
                if (!bool_0)
                {
                    this.RBLOKAnswerA.Enabled = true;
                }
                else
                {
                    this.RBLOKAnswerA.Enabled = false;
                }
                goto Label_0E6E;
                Label_051F:
                if (strArray3[num5].ToString() != "")
                {
                    switch (num5)
                    {
                        case 0:
                            this.txtRubricBA.Text = strArray3[num5].ToString();
                            break;

                        case 1:
                            this.txtRubricBB.Text = strArray3[num5].ToString();
                            break;

                        case 2:
                            this.txtRubricBC.Text = strArray3[num5].ToString();
                            break;

                        case 3:
                            this.txtRubricBD.Text = strArray3[num5].ToString();
                            break;

                        case 4:
                            this.txtRubricBE.Text = strArray3[num5].ToString();
                            break;

                        case 5:
                            this.txtRubricBF.Text = strArray3[num5].ToString();
                            break;
                    }
                }
                num5++;
                Label_05F1:
                if (num5 < strArray3.Length)
                {
                    goto Label_051F;
                }
                string[] strArray2 = reader["OKAnswer"].ToString().Split(new char[] { '#' });
                for (int i = 0; i < strArray2.Length; i++)
                {
                    this.CBLOKAnswerB.Items.FindByText(strArray2[i].Trim()).Selected = true;
                }
                if (!bool_0)
                {
                    this.CBLOKAnswerB.Enabled = true;
                }
                else
                {
                    this.CBLOKAnswerB.Enabled = false;
                }
                goto Label_0E6E;
                Label_0743:
                this.RBLOKAnswerC.Items.FindByValue("Y").Selected = true;
                Label_075E:
                if (!bool_0)
                {
                    this.RBLOKAnswerC.Enabled = true;
                }
                else
                {
                    this.RBLOKAnswerC.Enabled = false;
                }
                goto Label_0E6E;
                Label_0826:
                if (strArray[num2].ToString() != "")
                {
                    switch (num2)
                    {
                        case 0:
                            this.txtRubricDA.Text = strArray[num2].ToString();
                            break;

                        case 1:
                            this.txtRubricDB.Text = strArray[num2].ToString();
                            break;

                        case 2:
                            this.txtRubricDC.Text = strArray[num2].ToString();
                            break;

                        case 3:
                            this.txtRubricDD.Text = strArray[num2].ToString();
                            break;

                        case 4:
                            this.txtRubricDE.Text = strArray[num2].ToString();
                            break;

                        case 5:
                            this.txtRubricDF.Text = strArray[num2].ToString();
                            break;
                    }
                }
                num2++;
                Label_08F8:
                if (num2 < strArray.Length)
                {
                    goto Label_0826;
                }
                if (!bool_0)
                {
                    this.txtRubricDA.Enabled = true;
                    this.txtRubricDB.Enabled = true;
                    this.txtRubricDC.Enabled = true;
                    this.txtRubricDD.Enabled = true;
                    this.txtRubricDE.Enabled = true;
                    this.txtRubricDF.Enabled = true;
                }
                else
                {
                    this.txtRubricDA.Enabled = false;
                    this.txtRubricDB.Enabled = false;
                    this.txtRubricDC.Enabled = false;
                    this.txtRubricDD.Enabled = false;
                    this.txtRubricDE.Enabled = false;
                    this.txtRubricDF.Enabled = false;
                }
                goto Label_0E6E;
                Label_0C9F:
                this.labOptionAnswerFileH.Visible = false;
                this.labOptionAnswerFileH.Text = str2;
                this.labLookOptionAnswerFileH.Visible = true;
                this.LBDelOptionAnswerFileH.Visible = true;
                this.labLookOptionAnswerFileH.Text = "<a href='../FrmDownLoad.aspx?FileName=" + str2 + "' target='_blank'>查看原题</a>";
                Label_0CEA:
                if (reader["OKAnswer"].ToString().Trim() != "")
                {
                    this.labOKAnswerFileH.Visible = false;
                    this.labOKAnswerFileH.Text = reader["OKAnswer"].ToString().Trim();
                    this.labLookOKAnswerFileH.Visible = true;
                    this.LBDelOKAnswerFileH.Visible = true;
                    this.labLookOKAnswerFileH.Text = "<a href='../FrmDownLoad.aspx?FileName=" + reader["OKAnswer"].ToString().Trim() + "' target='_blank'>查看答案</a>";
                }
                else
                {
                    this.labOKAnswerFileH.Visible = false;
                    this.labOKAnswerFileH.Text = "";
                    this.labLookOKAnswerFileH.Visible = false;
                    this.LBDelOKAnswerFileH.Visible = false;
                }
                goto Label_0E6E;
                Label_0E62:
                this.txtOKAnswerJ.Enabled = false;
                Label_0E6E:
                this.DDLDiff.SelectedIndex = -1;
                this.RBLIsCheck.SelectedIndex = -1;
                this.DDLDiff.Items.FindByValue(reader["Difficulty"].ToString()).Selected = true;
                this.RBLIsCheck.Items.FindByValue(reader["ISCheck"].ToString()).Selected = true;
                this.RBLIsShare.Items.FindByValue(reader["ISShare"].ToString()).Selected = true;
                this.DDLSubject.Items.FindByValue(reader["SubjectID"].ToString()).Selected = true;
                Label_0F22:
                reader.Close();
                connection.Close();
                connection.Dispose();
            }
            catch
            {
            }
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            this.httpCookie_0 = new HttpCookie("ExamUserCode");
            this.httpCookie_0 = base.Request.Cookies["ExamUserCode"];
            this.httpCookie_1 = new HttpCookie("ExamUserName");
            this.httpCookie_1 = base.Request.Cookies["ExamUserName"];
            this.httpCookie_2 = new HttpCookie("ExamUserLevel");
            this.httpCookie_2 = base.Request.Cookies["ExamUserLevel"];
            this.httpCookie_3 = new HttpCookie("ExamDeptID");
            this.httpCookie_3 = base.Request.Cookies["ExamDeptID"];
            this.int_0 = Convert.ToInt32(base.Request["ID"].ToString());
            if (!((this.httpCookie_0 != null) ? !(this.httpCookie_0.Value == "") : false))
            {
                base.Response.Write("<script language=javascript>top.location.href='../Index.htm';self.close();</script>");
            }
            else
            {
                base.Response.Cache.SetCacheability(HttpCacheability.NoCache);
                base.Response.Cache.SetNoStore();
                this.httpCookie_0.Value = this.publicFun_0.CheckString(base.Server.UrlDecode(this.httpCookie_0.Value));
                this.httpCookie_1.Value = this.publicFun_0.CheckString(base.Server.UrlDecode(this.httpCookie_1.Value));
                this.httpCookie_2.Value = this.publicFun_0.CheckString(base.Server.UrlDecode(this.httpCookie_2.Value));
                this.httpCookie_3.Value = this.publicFun_0.CheckString(base.Server.UrlDecode(this.httpCookie_3.Value));
                if (!base.IsPostBack)
                {
                    if (this.publicFun_0.ReturnPaperData() == "Yes")
                    {
                        SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["Conn"].ConnectionString);
                        connection.Open();
                        SqlCommand command = new SqlCommand("select AddRubric,ManagRubric from UserPower where UserCode='" + this.httpCookie_0.Value + "'", connection);
                        SqlDataReader reader = command.ExecuteReader(CommandBehavior.CloseConnection);
                        if (reader.Read())
                        {
                            this.ViewState["AddPower"] = reader["AddRubric"].ToString();
                            this.ViewState["ManagPower"] = reader["ManagRubric"].ToString();
                        }
                        reader.Close();
                        command.Dispose();
                        connection.Close();
                        connection.Dispose();
                        this.LBDelOptionAnswerFileH.Attributes.Add("onclick", "javascript:{if(confirm('确定删除原题文件吗？')==false) return false;}");
                        this.LBDelOKAnswerFileH.Attributes.Add("onclick", "javascript:{if(confirm('确定删除答案文件吗？')==false) return false;}");
                        this.PanalA.Visible = true;
                        this.PanalB.Visible = false;
                        this.PanalC.Visible = false;
                        this.PanelD.Visible = false;
                        this.PanelE.Visible = false;
                        this.PanelH.Visible = false;
                        this.PanelJ.Visible = false;
                        this.publicFun_0.LoadSubjectInfo(this.DDLSubject, this.httpCookie_0.Value, this.ViewState["ManagPower"].ToString(), "E", this.httpCookie_3.Value);
                        this.DDLSubject.Items.Insert(0, new ListItem("--请选择科目信息--", "0"));
                        if (this.int_0 != 0)
                        {
                            bool flag = false;
                            if (!(this.publicFun_0.GetValues("select PaperID from PaperData where '#'+RubricS+RubricD+RubricB+RubricF+RubricA+RubricC+RubricT+RubricAN+RubricO+RubricJ like '%#" + this.int_0 + "#%' and  PaperID in(select PaperID from ExamUser where Flag<>'A' and ExamType='A')", "PaperID") == ""))
                            {
                                flag = true;
                            }
                            else
                            {
                                flag = false;
                            }
                            if (flag)
                            {
                                base.Response.Write("<script>alert('因此道试题已被试卷使用并有考生作答记录所以此道试题题型和答案无法修改！')</script>");
                            }
                            this.method_0(flag);
                        }
                    }
                    else
                    {
                        base.Response.Write("<script>alert('此版本暂未授权,请拔打(0)13870606104手机号进行授权！')</script>");
                    }
                }
            }
        }
    }
}

